package en.edu.zucc.pb.loginapplication.categoryTab;


import java.util.List;

import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

public class FmPagerAdapter extends FragmentPagerAdapter {
    private List<Fragment> fragmentList;
    public List<String> strList;

    public FmPagerAdapter(List<String> strList, List<Fragment> fragmentList, FragmentManager fm) {
        super(fm);
        this.strList = strList;
        this.fragmentList = fragmentList;
    }

    @Override
    public int getCount() {
        return fragmentList != null && !fragmentList.isEmpty() ? fragmentList.size() : 0;
    }

    @Override
    public Fragment getItem(int position) {
        return fragmentList.get(position);
    }


    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        return strList.get(position);
    }
    

}
